package Model;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

public class FileLoader {
	
	public FileLoader(){
		
		
	}
	
	public ArrayList<String[]> load(){
		File file=new File("./res/monteentries.txt");
		String input;
		String[] test=new String[8];
		ArrayList<String[]> entries = new ArrayList<String[]>();
		try {
			Scanner reader=new Scanner(file);
			while(reader.hasNextLine()){
				input=reader.nextLine();
				test=input.split(",");
				entries.add(test);
				
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return entries;
	}
	
	public String[] loadTitles(){
		File file=new File("./res/monteentries.txt");
		String input;
		int counter=0;
		String[] entries = new String[10];
		try {
			Scanner reader=new Scanner(file);
			while(reader.hasNextLine()){
				input=reader.nextLine();
				entries[counter]=(input);
				counter++;
				
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return entries;
	}
}
